<%@ page contentType="text/html; charset=UTF-8" %><%@taglib prefix="s" uri="/struts-tags" %>
<s:if test="orders==null">
<div class="bottom-cart" id="bottom-cart">
  <div class="bottom-content">
    <div class="line-detail hidden">
      
      <table class="cart-detail-table table table-bordered table-striped hidden" id="cart-detail-table-empty">
        <thead>
          <tr>
            <th class="name">美食名称</th>
            <th class="price">单价</th>
            <th class="quantity">数量</th>
            <th class="subtotal">总价</th>
            <th class="action">
                <a href="shopping.action?action=remove">清空</a>
                <span class="cart-close"></span>
            </th>
          </tr>
        </thead>
      </table>
    </div>

    <div class="line-brief" style="">
              <div class="col-group closed"  id="col-group-0">
            我的购物车
        </div>
        <div class="col-desc">
            请选择你喜欢的美食
        </div>
            <div class="col-button">
              <button class="btn btn-yellow cart-btn"><span class="cart-checkout">买单</span></button>
            </div>
      <div class="col-total">
        共 0 个购物车 | 0 份美食 | 合计 0 元
      </div>
    </div>
    <div id="cart-add-effect"><img src="images/cart_arrow_down.png" alt="down_arrow"></div>
  </div>

</div>
<script type="text/javascript">
      var cart = {
          restaurant_id:0,
          restaurant_min_deliver_amount:0,
          total_amount:0,
          total_quantity:0,
          deliver_amount_message:"对不起，你的美食购物车为空，请继续选购其他美食"
      };
            
</script>

</s:if>
<s:if test="orders!=null">
<div class="bottom-cart" id="bottom-cart">
  <div class="bottom-content">
    <div class="line-detail hidden">
        <table class="cart-detail-table table table-bordered table-striped hidden" id="cart-detail-table-0">
            <thead>
              <tr>
                <th class="name">美食名称</th>
                <th class="price">单价</th>
                <th class="quantity">数量</th>
                <th class="subtotal">总价</th>
                <th class="action">
                    <a class="cart-action cart-clear-group" href="shopping.action?action=remove">清空</a>
                    <span class="cart-close"></span>
                </th>
              </tr>
            </thead>
            <tbody>
            	<s:if test="orders.menuList!=null">
            	<s:iterator id="ml" value="%{orders.menuList}">
              	<tr class="food-line" rel="<s:property value="orders.id"/>">
                  <td class="name"><span><s:property value="#ml.menuName"/></span></td>
                  <td class="price">￥<s:property value="#ml.priceShow"/></td>
                  <td class="quantity">
                      <a href="shopping.action?action=reduce&resId=<s:property value="orders.resId"/>&menuName=<s:property value="#ml.menuName"/>&copies=<s:property value="#ml.copies"/>&resName=<s:property value="orders.resName"/>" class="cart-action cart-decrease"></a>
                      <input class="order-item" type="text" autocomplete="off" value="<s:property value="copies"/>" parent_entity_id="0" group_id="0" />
                      <a href="shopping.action?action=add&resId=<s:property value="orders.resId"/>&menuName=<s:property value="#ml.menuName"/>&copies=<s:property value="#ml.copies"/>&resName=<s:property value="orders.resName"/>" class="cart-action cart-increase"></a>
                  </td>
                  <td class="subtotal">￥<s:property value="#ml.totalPriceShow"/></td>
                  <td class="action"><a href="shopping.action?action=removeById&resId=<s:property value="orders.resId"/>&menuName=<s:property value="#ml.menuName"/>&copies=<s:property value="#ml.copies"/>&resName=<s:property value="orders.resName"/>" class="cart-action cart-delete"></a></td>
                </tr>
                </s:iterator>
                </s:if>
                </tbody>
          </table>
              
      <table class="cart-detail-table table table-bordered table-striped hidden" id="cart-detail-table-empty">
        <thead>
          <tr>
            <th class="name">美食名称</th>
            <th class="price">单价</th>
            <th class="quantity">数量</th>
            <th class="subtotal">总价</th>
            <th class="action">
                <a href="shopping.action?action=remove">清空</a>
                <span class="cart-close"></span>
            </th>
          </tr>
        </thead>
      </table>
    </div>

    <div class="line-brief">
              <div class="col-restaurant-name">
            <s:property value="orders.resName"/>        </div>
                          <div class="col-group closed " id="col-group-0" rel="0">
            我的购物车
          </div>
          <!-- 
                <div class="col-add-group hidden">
            增加购物车
        </div>
                <div class="col-desc " id="col-desc-0">
           咖喱鸡肉饭 1份 / 劲辣鸡腿饭 1份 / 鲜蔬蘑菇饭 1份 / 酸豆角肉沫饭 1份        </div> -->
                    <div class="col-button">
                    			<!-- 两个按钮同时显示一个 -->
                                <button class="btn btn-need-add" rel="tooltip" data-placement="top" data-original-title="满起送价即可买单">
                                <span class="cart-checkout">还需要<span class="red"><s:property value="orders.delivery"/>元</span>起送</span></button>
                                
   								<button class="btn btn-yellow cart-btn"><span class="cart-checkout">买单</span></button>

                    </div>
      <div class="col-total">
        共 1 个购物车 | <s:property value="orders.totalCopies"/> 份美食 | 合计 <s:property value="orders.totalPriceShow"/> 元
      </div>
    </div>
    <div id="cart-add-effect"><img src="images/cart_arrow_down.png" alt="down_arrow"></div>
  </div>

</div>

  <div id="modal-cart-not-the-same-restaurant" class="modal hide fade" style="display: none; ">
    <div class="modal-header">
      <a href="#" class="close">×</a>
      <h3>请先清空美食购物车</h3>
    </div>
    <div class="modal-body">
      <h3>美食购物车中包含来自<s:property value="orders.resName"/>的美食 </h3>
        <p>您需要先清空美食购物车才能挑选其他餐厅的美食哦:)</p>
    </div>
    <div class="modal-footer">
      <a href="#" class="btn clear-cart">清空美食购物车</a>
      <a href="#" class="btn btn-yellow complete">先去餐厅看看</a>
    </div>
  </div>

<script type="text/javascript">
      var cart = {
          restaurant_id:0,
          restaurant_min_deliver_amount:0,
          total_amount:0,
          total_quantity:0,
          deliver_amount_message:"对不起，你的美食购物车为空，请继续选购其他美食"
      };
        cart.restaurant_id = 11111;
        cart.restaurant_min_deliver_amount = 50;
        cart.total_amount = 42;
        cart.total_quantity = 4;
        cart.deliver_amount_message = "对不起，你的美食购物车未满餐厅起送价（50）元";
              
</script>
</s:if>